Replication Package for:

�Ethnoreligious Diversity and State-Building: Evidence from Pakistan�s Tribal Areas�
K. Krakowski et al., European Sociological Review

Overview:

This package contains all datasets and code necessary to replicate the figures and tables presented in the main text and appendix of the paper.

Structure of the Package:

The package consists of the following components:

1. Data preparation do-files (Stata)

There are three Stata .do files for data preparation. These must be run in sequential order, as indicated by the numbers in their filenames:
- FATA_prep_stata_01.do
- FATA_prep_stata_02.do
- FATA_prep_stata_03.do

These scripts clean and merge raw data, and generate the datasets used in the main analysis.

2. Replication of main analyses do-files (Stata)

Two Stata .do files reproduce all figures and tables from the main text and appendix, with the exception of Figure 2:
- FATA_replication_stata_1.do
- FATA_replication_stata_2.do

3. Materials to replicate Figure 2, create additional diversity measures, and calculate distances between villages (Python via Google Colab)

To replicate Figure 2 (heatmaps) and compute additional measures of diversity (e.g., alternate Herfindahl-Hirschman Indices used in Table A17) as well as calculate distances between villages, run the provided Python code in Google Colab:
- FATA_replication_colab.ipynb

To execute the code:
1. Open the notebook in Google Colab.
2. Upload the required data files located in the colab_data folder.
3. File formats include .csv and .xlsx.
4. File names must match those referenced in the code (they are pre-specified for clarity and consistency).

Notes
- All required data files are included in the package.
- Please ensure that Python dependencies (e.g., pandas, geopandas, matplotlib) are available in the Colab environment.

